import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'login',
    components: {
      default: () => import('../pages/login/index.vue')
    }
  },

  {
    path: '',
    name: 'layout',
    component: () => import('../pages/layout/index.vue'),
    redirect: '/statistics',
    children: [
      {
        path: '/workspace',
        component: () => import('../pages/workSpace/index.vue'),
        meta: {
          name: '工作台',
          id: 1,
          keepAlive: true
        }
      },
      {
        path: '/knowledgeBase',
        component: () => import('../pages/knowledgeBase/index.vue'),
        meta: {
          name: '知识库',
          id: 2,
          keepAlive: true
        }
      },
      {
        path: '/modelMent',
        component: () => import('../pages/modelMent/index.vue'),
        meta: {
          name: '模型管理',
          id: 3,
          keepAlive: true
        }
      },
      {
        path: '/userlist',
        component: () => import('../pages/department/user/index.vue'),
        meta: {
          name: '用户管理',
          id: 4,
          keepAlive: true
        }
      },
      {
        path: '/department',
        component: () => import('../pages/department/department/index.vue'),
        meta: {
          name: '部门管理',
          id: 5,
          keepAlive: true
        }
      },
      {
        path: '/role',
        component: () => import('../pages/department/role/index.vue'),
        meta: {
          name: '角色管理',
          id: 6,
          keepAlive: true
        }
      },
      {
        path: '/userinfo',
        component: () => import('../pages/userInfo/index.vue'),
        meta: {
          name: '个人信息',
          id: 7,
          keepAlive: true
        }
      },
      // {
      // 	path: '/business',
      // 	component: () => import('../pages/business/index.vue'),
      // 	meta: {
      // 		name: '业务',
      // 		id: 8,
      // 	}
      // },
      // {
      // 	path: '/tenantry',
      // 	component: () => import('../pages/tenantry/index.vue'),
      // 	meta: {
      // 		name: '租户',
      // 		id: 9,
      // 	}
      // },
      {
        path: '/system',
        component: () => import('../pages/system/index.vue'),
        meta: {
          name: '系统',
          id: 10,
          keepAlive: true
        }
      },
      {
        path: '/dictionary',
        component: () => import('../pages/modelSetting/dictionary/index.vue'),
        meta: {
          name: '字典管理',
          id: 12
        }
      },
      {
        path: '/metadata',
        component: () => import('../pages/modelSetting/metadata/index.vue'),
        meta: {
          name: '元数据管理',
          id: 13,
          keepAlive: true
        }
      },
      {
        path: '/datasource',
        component: () => import('../pages/modelSetting/dataSource/index.vue'),
        meta: {
          name: '数据源管理',
          id: 14,
          keepAlive: true
        }
      },
      {
        path: '/modelmanage',
        component: () => import('../pages/modelSetting/modelManage/index.vue'),
        meta: {
          name: '模型管理',
          id: 15
        }
      },
      {
        path: '/agentmanage',
        component: () => import('../pages/modelSetting/agentManage/index.vue'),
        meta: {
          name: '智能体管理',
          id: 16
        }
      },
      {
        path: '/dynamicform',
        component: () => import('../pages/dynamicForm/index.vue'),
        meta: {
          name: '动态表单',
          id: 11
        }
      },
      {
        path: '/workflow',
        meta: {
          name: '工作流',
          id: 17,
          keepAlive: false
        },
        component: () => import('../pages/workFlow/index.vue')
      },
      {
        path: '/app',
        meta: {
          name: '智能体',
          id: 18,
          keepAlive: false
        },
        component: () => import('../pages/workSpace/app/index.vue')
      },
      {
        path: '/mcp',
        meta: {
          name: 'MCP服务',
          id: 19,
          keepAlive: true
        },
        component: () => import('../pages/mcp/index.vue')
      },
      {
        path: '/plugin',
        meta: {
          name: '插件',
          id: 20,
          keepAlive: true
        },
        component: () => import('../pages/plugin/index.vue')
      },
      {
        path: '/chat',
        meta: {
          name: '对话',
          id: 21,
          keepAlive: false
        },
        component: () => import('../pages/chat/index.vue')
      },
      {
        path: '/intelligentAssistance',
        meta: {
          name: '智能辅助',
          id: 21,
          keepAlive: false
        },
        component: () => import('../pages/intelligentAssistance/index.vue')
      },
      {
        path: '/statistics',
        meta: {
          name: '业务首页',
          id: 22,
          keepAlive: false
        },
        component: () => import('../pages/statistics/index.vue')
      },
      {
        path: '/seatingAssistance',
        meta: {
          name: '坐席辅助',
          id: 23,
          keepAlive: false
        },
        component: () => import('../pages/seatingAssistance/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
